
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO

/*
----------------------------------------------------------------------------------------------------

-- Created By:  ()
-- Purpose: Inserts a record into the Article table
----------------------------------------------------------------------------------------------------
*/


CREATE PROCEDURE dbo.Article_Insert
(

	@Id int    OUTPUT,

	@LocalId nvarchar (20)  ,

	@Title nvarchar (200)  ,

	@Alias varchar (200)  ,

	@Summary nvarchar (500)  ,

	@Description ntext   ,

	@ArticleType varchar (20)  ,

	@Thumbnail varchar (200)  ,

	@IsPublished bit   ,

	@OrderIndex int   ,

	@IsAllowDelete bit   ,

	@PublishedDate datetime   ,

	@CreatedDate datetime   ,

	@UpdatedDate datetime   ,

	@CreatedUser varchar (50)  ,

	@UpdatedUser varchar (50)  
)
AS


				
				INSERT INTO [dbo].[Article]
					(
					[LocalId]
					,[Title]
					,[Alias]
					,[Summary]
					,[Description]
					,[ArticleType]
					,[Thumbnail]
					,[IsPublished]
					,[OrderIndex]
					,[IsAllowDelete]
					,[PublishedDate]
					,[CreatedDate]
					,[UpdatedDate]
					,[CreatedUser]
					,[UpdatedUser]
					)
				VALUES
					(
					@LocalId
					,@Title
					,@Alias
					,@Summary
					,@Description
					,@ArticleType
					,@Thumbnail
					,@IsPublished
					,@OrderIndex
					,@IsAllowDelete
					,@PublishedDate
					,@CreatedDate
					,@UpdatedDate
					,@CreatedUser
					,@UpdatedUser
					)
				
				-- Get the identity value
				SET @Id = SCOPE_IDENTITY()
									
							
			

GO
